﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EntitiesLayer
{
    public class Match : EntityObject
    {
        #region Properties

        public int CoupeID
        {
            get;
            set;
        }

        public DateTime Date
        {
            get;
            set;
        }

        public Equipe EquipeDomicile
        {
            get;
            set;
        }

        public Equipe EquipeVisiteuse
        {
            get;
            set;
        }

        public double Prix
        {
            get;
            set;
        }

        public int ScoreEquipeDomicile
        {
            get;
            set;
        }

        public int ScoreEquipeVisiteuse
        {
            get;
            set;
        }

        public Stade Stade
        {
            get;
            set;
        }

        #endregion

        #region Constructors

        public Match() : this(0, DateTime.Now, null, null, 0, 0, 0, null, 0) { }

        public Match(int coupeID, DateTime date, Equipe eqDom, Equipe eqVis, double prix, int scoreDom, int scoreVis, Stade stade, int id)
            : base(id)
        {
            CoupeID = coupeID;
            Date = date;
            EquipeDomicile = eqDom;
            EquipeVisiteuse = eqVis;
            Prix = prix;
            ScoreEquipeDomicile = scoreDom;
            ScoreEquipeVisiteuse = scoreVis;
            Stade = stade;
        }

        #endregion

        public override string ToString()
        {
            if (ID == 0)
                return "New Match";

            return ID + ":" + EquipeDomicile.Nom + "/" + EquipeVisiteuse.Nom;
        }
    }
}
